<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  <%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Client Profile</title>
<link rel="stylesheet" type="text/css" href="css/style-old.css" />
<link rel="stylesheet" type="text/css" href="css/tcal.css" />
<link rel="stylesheet" type="text/css" href="css/easyui.css" />
	<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css"/>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> 
<script type="text/javascript" src="js/tcal.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddaccordion.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />

<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader", 
	contentclass: "submenu",
	revealtype: "click", 
	mouseoverdelay: 200, 
	collapseprev: true, 
	defaultexpanded: [], 
	onemustopen: false, 
	animatedefault: false, 
	persiststate: true,
	toggleclass: ["", ""], 
	togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"],
	animatespeed: "fast", 
	oninit:function(headers, expandedindices){
	},
	onopenclose:function(header, index, state, isuseractivated){ 
	}
});

 $(document).ready(function() {
	$("#Go").click(function(){
			$.ajax({ 
				type: "POST",
			url : './user/fenlgr',
			dataType: "json",
			contentType: 'application/json',			  
			  data:JSON.stringify({ "fromDate":$("#fromDate").val(),"toDate":$("#toDate").val(),"trnxFilter":$("#trnxFilter").val()}),
			success : function(jsonData) {
				if(jsonData!=null){
									var a=0;
					                $("#datatable").find("tr").remove();
									var i=0;					
					                var table1 = $("#tableHead");
					                var row= $("<tr  style='background:#000000; color:#FFFFFF;'>"+
					                "<th >ID</th>"+
					                "<th >Cash Limit</th>"+
					                "<th >Margin Limit</th>"+
					                "<th >Credit Amount</th>"+
					                "<th >Debit Amount</th>"+
					                "<th >Bill No</th>  "+
					                "<th >ChequeNo</th>"+
					             "</tr>");
					                row.appendTo(table1);
					                var table2=$("#tableBody");
					               var select=document.getElementById("trnxFilter").value;
					               
					              $.each(jsonData, function(key,value) {
					            	  
					              var rowNew = $("<tr style='text-align:center'><td ></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>");
					                        rowNew.children().eq(0).text(++i);
					                        rowNew.children().eq(1).text(value['cashl']);
					                        rowNew.children().eq(2).text(value['marginl']);
					                        rowNew.children().eq(3).text(value['creditamt']);
					                        rowNew.children().eq(4).text(value['debitamt']);
					                        if(select=='All Entires'){
					                        	  rowNew.children().eq(5).text(value['billno']);
							                        rowNew.children().eq(6).text(value['chequeno']);
							                        	
					                        }
					                        else if(select=='Daily Bills'){
					                        		rowNew.children().eq(5).text(value['billno']);
					                        	    rowNew.children().eq(6).text('-');
								                          
					                        	}
					                        else	if(select=='Bank')
					                        			{
					                        	rowNew.children().eq(5).text('-');
				                        	 	
					                        	rowNew.children().eq(6).text(value['chequeno']);
								                        	
					                        			}
					                        rowNew.appendTo(table2);
					                        $("#tableBody tr:even").css("background-color", "#CCC");
						                	$("#tableBody tr:odd").css("background-color", "#FFF");
					                });
					                }
}
		});
		});
	
	});
 
 function prof()
 {
 if (container1.style.display=="none") container1.style.display="block"; 
 else container1.style.display="block";
 }
 
 function logout(){
	 alert("You are Logout SuccessFully");
	 }

</script>

</head>
<body>
  <%@ include file="header.jsp" %>	
    
    <div class="main_content">
    
                    <div class="menu">
                    <ul>
                    <li>LoginID : <sec:authentication property="principal.username" /></li>
                    <li><a href="#">Exchange :
                       <select style="height:15px;font-size:9px;"><option>NMCEX</option></select></a>
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                    </li>
                    <li><a href="#">Login Type : Client<!--[if IE 7]><!--></a><!--<![endif]-->
                    <!--[if lte IE 6]><table><tr><td><![endif]-->
                      
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                    </li>
                    <li><a href="#">Segment : <select style="height:16px;font-size:9px;"><option>commodity mkt(13-14)</option></select><!--[if IE 7]><!--></a><!--<![endif]-->
                       
                    </li>
                  
                    </ul>
                    </div> 
                    
                    
                    
                    
    <div class="center_content">  
    
    
    
    <div class="left_content">
    
    		<div class="sidebar_search">
            <form>
            <input type="text" name="" class="search_input" value="search keyword" onclick="this.value=''" />
            <input type="image" class="search_submit" src="images/search.png" />
            </form>            
            </div>
    
            <div class="sidebarmenu">
            
                <a class="menuitem submenuheader" href="">Profile</a>
                <div class="submenu">
                    <ul>
                    <li onclick="prof('container1');"><a href="clientpage">Directory</a></li>
               
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="" >Financial</a>
                <div class="submenu">
                    <ul>
                    <li><a href="drcr">Dr./Cr. Summary</a></li>
                    <li><a href='fenlgr'>Financial Ledger</a></li>
                   <!--  <li><a href="agingreport">Ageing</a></li> -->
                    
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Reports</a>
                <div class="submenu">
                    <ul>
                     <li><a href="tradeconf">Trade Conf.</a></li>
                    <li><a href="netpos">N.Pos(As on)</a></li>
                    <li><a href="clientport">PortFolio</a></li>
                    <li><a href="bills">Bills</a></li>
                 
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Downloads</a>
                 <div class="submenu">
                    <ul>
                   <li><a href="pdf/oct_hn.pdf">Downloads</a></li>
                    <li><a href="pdf/TB_Trading_Regulations.pdf">Reports</a></li>
                    <li><a href="csv/test5.csv">Digital</a></li>
                     </ul>
                </div>
                <a class="menuitem submenuheader" href="">Request</a>
                 <div class="submenu">
                    <ul>
                   <li ><a href="withdrawal">WithDrawal Request</a></li>
                <li ><a href="clientfundview">Client Fund View</a></li>
                <li ><a href="fundTransfer">Fund Transfer</a></li>
                    </ul>
                </div>
                <a class="menuitem submenuheader" href="">Admin Panel</a>
                 <div class="submenu">
                   <ul>
                 
                   <li ><a href="nepalholiday">Nepal Holiday List</a></li>
                    </ul>
                </div>
               <a class="menuitem submenuheader" href="">Settings</a>
                 <div class="submenu">
                    <ul>
                    <li ><a href="changepwd">Password Change</a></li>
                    <li ><a href="transactionpwd">Transaction Password Change</a></li>
                    </ul>
                </div>
                    
            </div>
            
            
    
    </div>  
    
    <div id="container1" class="right_content" >            
<div style="text-align:center;">
<label style=" width:100%;font-size:16px;" ><font color="#663380"><b><i>Financial Ledger </i></b></font> </label>
<label style="margin-right:5px; float:right;" ></label>
</div><br/>
  <table width="60%" border="1" cellpadding="0" cellspacing="0" align="center" style="font-family:helvetica; font-size:11px;">
  
    <tr style="">
      <td style="width:250px; font-family:helvetica;"><b>Client ID :</b></td>
      <td style="width:250px;"><select style="font-family:helvetica; font-size:11px;"><option><sec:authentication property="principal.username" /></option></select></td>
      
    </tr>

	<tr>
      <td><b>Date From :</b></td>
      <td><div class="search_rightfield"><input type="text" name="fromDate" id="fromDate"  class="tcal" style="font-family:helvetica; font-size:11px;"  /></div></td>
     
    </tr>
     <tr>
      <td><b>Date To :</b></td>
      <td><div class="search_rightfield"><input type="text" name="toDate" id="toDate"  class="tcal" style="font-family:helvetica; font-size:11px;"  /></div></td>
     
    </tr>
     <tr>
      <td><b>Seg. Selection :</b></td>
      <td><select style="font-family:helvetica; font-size:11px;" id="segSelect"><option>Combined</option>
      <option>NCMX</option>
      </select></td>
     
    </tr>
    <tr>
      <td><b>Trnx. Filter:</b></td>
      <td>
      <select style="font-family:helvetica; font-size:11px;" id="trnxFilter">
      <option >All Entires</option>
      <option>Daily Bills</option>
      <option>Bank</option>
      </select></td>
     
    </tr>
    <tr><td><input type="button" value="Go" id="Go" /></td>
    <td>&nbsp;</td></tr>
  </table>
  <br />
  

    
    
  <div id="container" style="height:200px; overflow:scroll;overflow: auto">
<table  id="datatable" cellspacing="0" cellpadding="0" border="0" width="300"  style="width:100%;" singleSelect="true" iconCls="icon-save">
<thead id="tableHead"></thead>
<tbody id="tableBody"></tbody>
    
    </table> 
 </div>   
   </div>
   
  </div>   
     <div id="tablediv">



                                   
                    
    
    
    <div class="clear"></div>
    </div> 
	
    
  <%@ include file="footer.jsp" %>			
</body>
</html>